package ca.starfarer.kobold.model;

/**
 * @author Kevin
 */
public class DamageType {

    // TODO: We need to handle combinations like "fire and cold" or "lightning and thunder"

    /** Any corrosive substance */
    public static final DamageType ACID = new DamageType("acid");

    /** Frigid temperatures */
    public static final DamageType COLD = new DamageType("cold");

    /** High heat and flames */
    public static final DamageType FIRE = new DamageType("fire");

    /** Kinetic energy */
    public static final DamageType FORCE = new DamageType("force");

    /** High voltage */
    public static final DamageType LIGHTNING = new DamageType("lightning");

    /** Draining the very essence of life */
    public static final DamageType NECROTIC = new DamageType("necrotic");

    /** Definitely not healthy */
    public static final DamageType POISON = new DamageType("poison");

    /** Damages the mind */
    public static final DamageType PSYCHIC = new DamageType("psychic");

    /** The power of righteous might */
    public static final DamageType RADIANT = new DamageType("radiant");

    /** Loud noises and sonic booms */
    public static final DamageType THUNDER = new DamageType("thunder");

    private final String name;

    /**
     * Hidden constructor to prevent arbitrary sub-classing
     * @param name the damage type's name
     */
    private DamageType(String name) {
        assert name != null;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj != null && obj.getClass() == this.getClass()) {
            DamageType that = (DamageType) obj;
            return name.equals(that.name);
        }
        return false;
    }

    @Override
    public int hashCode() {
        return name.hashCode();
    }

    @Override
    public String toString() {
        return getName();
    }
}

